<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
    <head>
        <title>Administration Console</title>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
		<meta http-equiv="Cache-Control" content="no-store" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		<link rel="shortcut icon" type="image/png" href="${ctx }/static/images/favicon.png">
		<link rel="stylesheet" media="screen" href="${ctx }/static/bootstrap/2.1.1/css/bootstrap.min.css">
		<link href="${ctx}/static/jquery-validation/1.10.0/validate.css" type="text/css" rel="stylesheet" />
		
		<script src="${ctx}/static/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
		<script src="${ctx}/static/jquery-validation/1.10.0/jquery.validate.min.js" type="text/javascript"></script>
		<script src="${ctx}/static/jquery-validation/1.10.0/messages_bs_zh.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
	
	$(document).ready(function() {
		//聚焦第一个输入框
		$("#username").focus();
		
		$("#username").keypress(function(event){
			var keycode = event.which;  
			if(keycode==13){
				$("#password").focus();
			}
		});
		
		$("#password").keypress(function(event){
			var keycode = event.which;  
			if(keycode==13){
				login();
			}
		});
		
		//为loginForm注册validate函数
		$("#loginForm").validate();
	});
	

	function login(){
		$("#loginForm").submit();
	}
</script>
     <!-- Modal -->
     <div class="modal">
       <div class="modal-header">
         <a href="#" class="close">&times;</a>
         <h2>后台管理</h2>
       </div>
       <div class="modal-body">
        <form id="loginForm" method="post" action="${ctx}/login">
        <label>用户名：</label>
        <input type="text" id="username" name="username" value="345343747@qq.com" class="input-large required" /><br>
		<br>
        <label>密  码：</label>
        <input  type="password" id="password" name="password" value="" class="input-large required" />
        </form>
       </div>
       <div class="modal-footer">
         <a href="#" class="btn">取消</a>
         <a href="#" class="btn btn-primary" onclick="login()">登录</a>
       </div>
     </div>

